<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="" method="get">
    {% csrf_token %}
    <input type="search" name="uname">
    <input type="submit" value="搜索">
</form>
<a href="{% url 'add_user' %}">添加</a>
<table border="1" cellspacing="0">
    <tr>
        <th>用户名</th>
        <th>真实姓名</th>
        <th>电话</th>
        <th>性别</th>
        <th>角色</th>
        <th>地址</th>
        <th colspan="2">操作</th>
    </tr>
    {% for i in list %}
    <tr>
        <td>{{ i.uname }}</td>
        <td>{{ i.truename }}</td>
        <td>{{ i.tel }}</td>
        <td>{{ i.get_sex_display }}</td>
        <td>{{ i.roleid.rolename }}</td>
        <td>{{ i.address }}</td>
        <td><a href="{% url 'edit_user' i.id %}">修改</a></td>
        <td><a href="{% url 'del_user' i.id %}">删除</a></td>
    </tr>
    {% endfor %}
</table>
</body>
</html>